<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>福利</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="../css/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="../css/auislide.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <style>
        .empty{ text-align: center; padding: 120px 0; }
    </style>
</head>
<body>
  <div id="aui-slide"  class="fx-box">
    <div id="slidebox" class="aui-slide-wrap" style="margin: 10px;border-radius:0.5rem;box-shadow:0.1rem 0.1rem 0.4rem rgba(99, 99, 99, 0.3);" >

                      <!--顶部横幅未加载完成时的提示-->
                        <img id="bpic" src="../image/app/yaoshen.jpg"  onClick="UnloadedCompleted()">
                      <!--顶部横幅未加载完成时的提示-->


    </div>
    <div class="aui-slide-page-wrap"><!--分页容器--></div>
  </div>

  <div class="list-title">
    <div class="list-title-l">
      <span style="color:#585858;font-size: 0.7rem"><i class="iconfont icon-zuirehotchunse" style="color:#ff7600;font-size: 0.8rem"></i>福利推荐</span>
    </div>

  </div>


  <section class="aui-grid aui-margin-b-15">
      <div class="aui-row" id="fl_list">

        <!--VIP 观影区未加载完成时的提示-->



            <div class="aui-col-xs-3 pt-list" tapmode onClick="UnloadedCompleted()">
            <i class="aui-iconfont"><img src="../image/app/ico_loading.gif"/></i>
            <div class="aui-grid-label">爱奇艺</div>
          </div>

          <div class="aui-col-xs-3 pt-list" tapmode onClick="UnloadedCompleted()">
          <i class="aui-iconfont"><img src="../image/app/ico_loading.gif"/></i>
          <div class="aui-grid-label">腾讯视频</div>
          </div>

          <div class="aui-col-xs-3 pt-list" tapmode onClick="UnloadedCompleted()">
          <i class="aui-iconfont"><img src="../image/app/ico_loading.gif"/></i>
          <div class="aui-grid-label">优酷视频</div>
          </div>

          <div class="aui-col-xs-3 pt-list" tapmode onClick="UnloadedCompleted()">
          <i class="aui-iconfont"><img src="../image/app/ico_loading.gif"/></i>
          <div class="aui-grid-label">搜狐视频</div>
          </div>

          <div class="aui-col-xs-3 pt-list" tapmode onClick="UnloadedCompleted()">
          <i class="aui-iconfont"><img src="../image/app/ico_loading.gif"/></i>
          <div class="aui-grid-label">芒果TV</div>
          </div>

          <div class="aui-col-xs-3 pt-list" tapmode onClick="UnloadedCompleted()">
          <i class="aui-iconfont"><img src="../image/app/ico_loading.gif"/></i>
          <div class="aui-grid-label">PPTV</div>
          </div>

          <div class="aui-col-xs-3 pt-list" tapmode onClick="UnloadedCompleted()">
          <i class="aui-iconfont"><img src="../image/app/ico_loading.gif"/></i>
          <div class="aui-grid-label">暴风影音</div>
          </div>

          <div class="aui-col-xs-3 pt-list" tapmode onClick="UnloadedCompleted()">
          <i class="aui-iconfont"><img src="../image/app/ico_loading.gif"/></i>
          <div class="aui-grid-label">M1905</div>
          </div>


        <!--VIP 观影区未加载完成时的提示-->


      </div>
   

  </section>



  <div class="fx-box" id="guanggao">

          <div  class="aui-slide-wrap" style="margin: 10px;border-radius:0.5rem;box-shadow:0.1rem 0.1rem 0.4rem rgba(99, 99, 99, 0.3);" >

                            <!--顶部横幅未加载完成时的提示-->
                              <img id="bpic" src="../image/default_picture/default_banner.png"  onClick="UnloadedCompleted()">
                            <!--顶部横幅未加载完成时的提示-->

          </div>




          <div  class="aui-slide-wrap" style="margin: 10px;border-radius:0.5rem;box-shadow:0.1rem 0.1rem 0.4rem rgba(99, 99, 99, 0.3);" >

                            <!--顶部横幅未加载完成时的提示-->
                              <img id="bpic" src="../image/default_picture/default_banner.png"  onClick="UnloadedCompleted()">
                            <!--顶部横幅未加载完成时的提示-->
          </div>


</div>






  <div class="">

  </div>
</body>
<script type="text/x-dot-template" id="bannertpl">
  {{~ it.data : value : index }}
    <div class="aui-slide-node bg-dark" tapmode onclick="toBanner('{{= value. linkurl }}')">
        <img src="http://video.jikue.com/{{= value. picurl }}" />
    </div>
  {{~}}
</script>
<script type="text/x-dot-template" id="flicotpl">
  {{~ it.data : value : index }}
  		<div class="aui-col-xs-3 pt-list" tapmode onclick="toBanner('{{= value. linkurl }}')">
          <i class="aui-iconfont"><img src="http://video.jikue.com/{{= value. picurl }}"/></i>
          <div class="aui-grid-label">{{= value. name }}</div>
        </div>

  {{~}}
</script>
<script type="text/x-dot-template" id="guanggaotpl">
  {{~ it.data : value : index }}


  <div  class="aui-slide-wrap" style="margin: 10px;border-radius:0.5rem;box-shadow:0.1rem 0.1rem 0.4rem rgba(99, 99, 99, 0.3);" >

                      <img  src="http://video.jikue.com/{{= value. picurl }}"  tapmode onclick="toBanner('{{= value. linkurl }}')">

  </div>

  {{~}}
</script>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/doT.js"></script>
<script type="text/javascript" src="../script/auipullrefresh.js"></script>
<script type="text/javascript" src="../script/auislide.js"></script>
<script type="text/javascript" src="../script/auilazyload.js" ></script>
<script type="text/javascript">

//alert(localStorage.getItem('fxpic1'));
  var slide = new auiSlide({
      container:document.getElementById("aui-slide"),
      // "width":300,
  //    "height":200,
      "speed":300,
      "pageShow":true,
      "autoPlay": 5000,
      "pageStyle":'dot',
      "loop":true,
      'dotPosition':'center',
  });
  new auiLazyload({
      errorImage:'../image/error-img.jpg'
  });
  var api_url = localStorage.getItem('api_url');
  apiready = function(){




    //下拉刷新
        api.setCustomRefreshHeaderInfo({
            bgColor : '#fff',
             images: [
                  'widget://image/app/xiala/cd.png',
                    ],
                    tips: {
                        pull: '你…你想干什么！你不要过来！',
                        threshold: '讨厌 快放开我 非礼呀！',
                        load: '蜜袋影视 服务完美'
                    }

        }, function() {

            setTimeout(function(){
        api.refreshHeaderLoadDone()
            }, 3000);
        });
        //下拉刷新




    api.parseTapmode();

	getNav();
  }



function imgUrl(url){



      if (url == '') {


        api.toast({
            msg: '蜜袋影视提醒！暂无详情'
        });

      }else {





                            api.ajax({
                                url: api_url+'/login/login/banben.html',
                                method: 'get'
                            },function(ret, err){
                                if (ret) {



                                             api.toast({
                                                 msg: '加载中'
                                             });



                                             api.openWin({
                                                 name: 'h5',
                                                 url: './h5.html',
                                                 pageParam: {
                                                     url: url
                                                 }
                                             });





                                } else {


                                            NetworkConnectionFailurePrompt();

              }


          });


      }



}

function toBanner(url){

  if (url == '') {


    api.toast({
        msg: '蜜袋影视提醒！暂无详情'
    });

  }else {


                        api.ajax({
                            url: api_url+'/login/login/banben.html',
                            method: 'get'
                        },function(ret, err){
                            if (ret) {


                                         api.toast({
                                             msg: '加载中'
                                         });



                                               api.openWin({
                                                   name: 'h5',
                                                   url: './h5.html',
                                                   pageParam: {
                                                       url: url
                                                   }
                                               });




                            } else {
                                        NetworkConnectionFailurePrompt();

          }


      });


  }
}

  function openWin(name){
    var time = localStorage.getItem('user_time');
    var user_id = localStorage.getItem('user_id');
    var username = localStorage.getItem('user_name');
    var timestamp = Date.parse(new Date())/1000;
    if (user_id!=0) {
      api.alert({
          title: '请先登录',
          msg: '知道了',
      });
      return;
    }

    if (time > timestamp) {
      api.openWin({
          name: ''+name+'',
          url: ''+name+'.html',
          bounces:false,
          delay: 300
      });
    }else if (time == -1) {
      api.openWin({
          name: ''+name+'',
          url: ''+name+'.html',
          bounces:false,
          delay: 300
      });
    }else if (time < timestamp) {
      alert('到期啦~官人先开个VIP哟');
      api.openWin({
          name: 'open_vip_win',
          url: './open_vip_win.html',
      });
    }

  }

  function banNer(){
    var slide = new auiSlide({
        container:document.getElementById("aui-slide"),
        // "width":300,
        "height":150,
        "speed":300,
        "pageShow":true,
        "autoPlay": 5000,
        "pageStyle":'dot',
        "loop":true,
        'dotPosition':'center',
    });
  }


  function getNav(){
    var flid = $api.byId('fl_list');
    var fltpl = $api.byId('flicotpl');
	var bannerid = $api.byId('slidebox');
    var bannertpl = $api.byId('bannertpl');

    var guanggaoid = $api.byId('guanggao');
    var guanggaotpl = $api.byId('guanggaotpl');
    api.ajax({
        url: api_url+'/app/nav/fl',
        method: 'get',
    },function(ret, err){
        if (ret) {
          //渲染模板
          var pagefn = doT.template(fltpl.text);
          flid.innerHTML = pagefn(ret.tu);
          var pagefn = doT.template(bannertpl.text);
          bannerid.innerHTML = pagefn(ret.banner);
          var pagefn = doT.template(guanggaotpl.text);
          guanggaoid.innerHTML = pagefn(ret.guanggao);
           banNer();


        } else {

        }
    });
  }

  var timer = setInterval(function(){
      DataLoading();
  },1000)


  function DataLoading() {

    api.ajax({
        url: api_url+'/login/login/banben.html',
        method: 'get'
    },function(ret, err){
        if (ret) {

          getNav();

clearInterval(timer);
        }

    });




  }





function UnloadedCompleted(){

      api.toast({
          msg: '加载失败 请检查网络是否顺畅'
      });
}


    function fnRefreshHeaderLoading() {
        api.refreshHeaderLoading();
    };




</script>





</html>
